USE master
GO

CREATE LOGIN babel_5116_l1 WITH PASSWORD = '12345678'
GO
CREATE LOGIN babel_5116_l2 WITH PASSWORD = '12345678'
GO
CREATE LOGIN babel_5116_l3 WITH PASSWORD = '12345678'
GO
CREATE USER babel_5116_l1
GO
CREATE USER babel_5116_l2
GO
CREATE ROLE babel_5116_r1
GO
CREATE TABLE babel_5116_t1 (id INT)
GO
CREATE TABLE babel_5116_t3 (id INT)
GO
CREATE INDEX babel_5116_idx1 ON babel_5116_t1 (id)
GO
CREATE TRIGGER babel_5116_trig ON babel_5116_t1 AFTER INSERT AS SELECT 1
GO
CREATE VIEW babel_5116_v1 AS SELECT * FROM babel_5116_t1
GO
CREATE SEQUENCE babel_5116_s1 START WITH 1000 INCREMENT BY 1
GO
CREATE PROCEDURE babel_5116_p1 AS SELECT 1
GO
CREATE FUNCTION babel_5116_f1() RETURNS INT AS BEGIN RETURN 1 END
GO
CREATE FUNCTION babel_5116_tvf1()
RETURNS TABLE AS RETURN
(
    SELECT '1' AS col
);
GO
CREATE FUNCTION babel_5116_mtvf1()
RETURNS @result TABLE([Id] int) AS
BEGIN
    INSERT INTO @result VALUES (1) RETURN 
END
GO
CREATE TYPE babel_5116_type1 FROM sys.varchar(10)
GO
CREATE TYPE babel_5116_tabletype1 AS TABLE (id INT)
GO

CREATE DATABASE babel_5116_db
GO
USE babel_5116_db
GO

CREATE USER babel_5116_l1
GO
CREATE USER babel_5116_l2
GO
CREATE ROLE babel_5116_r1
GO
CREATE TABLE babel_5116_t1 (id INT, con_col INT NOT NULL CONSTRAINT babel_5116_constr1 UNIQUE)
GO
CREATE TABLE babel_5116_t3 (id INT)
GO
CREATE INDEX babel_5116_idx1 ON babel_5116_t1 (id)
GO
CREATE TRIGGER babel_5116_trig1 ON babel_5116_t1 AFTER INSERT AS SELECT 1
GO
CREATE VIEW babel_5116_v1 AS SELECT * FROM babel_5116_t1
GO
CREATE SEQUENCE babel_5116_s1 START WITH 1000 INCREMENT BY 1
GO
CREATE PROCEDURE babel_5116_p1 AS SELECT 1
GO
CREATE FUNCTION babel_5116_f1() RETURNS INT AS BEGIN RETURN 1 END
GO
CREATE FUNCTION babel_5116_tvf1()
RETURNS TABLE AS RETURN
(
    SELECT '1' AS col
);
GO
CREATE FUNCTION babel_5116_mtvf1()
RETURNS @result TABLE([Id] int) AS
BEGIN
    INSERT INTO @result VALUES (1) RETURN 
END
GO
CREATE TYPE babel_5116_type1 FROM sys.varchar(10)
GO
CREATE TYPE babel_5116_tabletype1 AS TABLE (id INT)
GO
CREATE SCHEMA babel_5116_sch1
GO
CREATE SCHEMA babel_5116_sch2 AUTHORIZATION babel_5116_r1
GO
